package ControlLayer;
import ModelLayer.OrderDiscount;
import DBLayer.DBOrderDiscount;
import java.util.ArrayList;

public class CtrOrderDiscount {
    // <editor-fold defaultstate="collapsed" desc="Attributes & Constructors">
    private static CtrOrderDiscount instance = null;
    DBOrderDiscount dbOrderDiscount = new DBOrderDiscount();

    public CtrOrderDiscount() {
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public static CtrOrderDiscount getInstance() {
        if (instance == null) {
            instance = new CtrOrderDiscount();
        }
        return instance;
    }

    public ArrayList<OrderDiscount> getOrderDiscountList() {
        return dbOrderDiscount.getOrderDiscountList();
    }

    public OrderDiscount getOrderDiscountByID(int id) {
        return dbOrderDiscount.getOrderDiscountByID(id);
    }

    public int addOrderDiscount(OrderDiscount orderDiscount) {
        return dbOrderDiscount.addOrderDiscount(orderDiscount);
    }

    public int updateOrderDiscount(OrderDiscount orderDiscount, int id) {
        return dbOrderDiscount.updateOrderDiscount(orderDiscount, id);
    }

    public void deleteOrderDiscount(int id) {
        dbOrderDiscount.deleteOrderDiscount(id);
    }
    // </editor-fold>
}
